#ifndef __Max30102_h
#define __Max30102_h

#include "main.h"

#define Max30102_INT  HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_12)

#define Max30102_Write_Address 0xAE
#define Max30102_Read_Address  0xAF
#define REG_INTR_STATUS_1 0x00
#define REG_INTR_STATUS_2 0x01
#define REG_INTR_ENABLE_1 0x02
#define REG_INTR_ENABLE_2 0x03
#define REG_FIFO_WR_PTR 0x04
#define REG_OVF_COUNTER 0x05
#define REG_FIFO_RD_PTR 0x06
#define REG_FIFO_DATA 0x07
#define REG_FIFO_CONFIG 0x08
#define REG_MODE_CONFIG 0x09
#define REG_SPO2_CONFIG 0x0A
#define REG_LED1_PA 0x0C
#define REG_LED2_PA 0x0D
#define REG_PILOT_PA 0x10
#define REG_MULTI_LED_CTRL1 0x11
#define REG_MULTI_LED_CTRL2 0x12
#define REG_TEMP_INTR 0x1F
#define REG_TEMP_FRAC 0x20
#define REG_TEMP_CONFIG 0x21
#define REG_PROX_INT_THRESH 0x30
#define REG_REV_ID 0xFE
#define REG_PART_ID 0xFF
extern I2C_HandleTypeDef hi2c2;

void Max30102_Init(void);
void Max30102_Reset(void);
void Max30102_Calculate_HR_BO_Value(void);
void Show_HR_BO(void);
int GetCurrentHeartRate(void);

#endif
